<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>handler_ptr</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Chapter&#160;1.&#160;Boost.Beast">
<link rel="up" href="../ref.html" title="This Page Intentionally Left Blank 2/2">
<link rel="prev" href="boost__beast__get_lowest_layer.html" title="get_lowest_layer">
<link rel="next" href="boost__beast__handler_ptr/element_type.html" title="handler_ptr::element_type">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="boost__beast__get_lowest_layer.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../ref.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="boost__beast__handler_ptr/element_type.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="beast.ref.boost__beast__handler_ptr"></a><a class="link" href="boost__beast__handler_ptr.html" title="handler_ptr">handler_ptr</a>
</h4></div></div></div>
<p>
        A smart pointer container with associated completion handler.
      </p>
<h5>
<a name="beast.ref.boost__beast__handler_ptr.h0"></a>
        <span class="phrase"><a name="beast.ref.boost__beast__handler_ptr.synopsis"></a></span><a class="link" href="boost__beast__handler_ptr.html#beast.ref.boost__beast__handler_ptr.synopsis">Synopsis</a>
      </h5>
<p>
        Defined in header <code class="literal">&lt;<a href="../../../../../../boost/beast/core/handler_ptr.hpp" target="_top">boost/beast/core/handler_ptr.hpp</a>&gt;</code>
      </p>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span>
    <span class="keyword">class</span> <span class="identifier">T</span><span class="special">,</span>
    <span class="keyword">class</span> <a href="../../../../../../doc/html/boost_asio/reference/Handler.html" target="_top"><span class="bold"><strong>Handler</strong></span></a><span class="special">&gt;</span>
<span class="keyword">class</span> <span class="identifier">handler_ptr</span>
</pre>
<h5>
<a name="beast.ref.boost__beast__handler_ptr.h1"></a>
        <span class="phrase"><a name="beast.ref.boost__beast__handler_ptr.types"></a></span><a class="link" href="boost__beast__handler_ptr.html#beast.ref.boost__beast__handler_ptr.types">Types</a>
      </h5>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
</colgroup>
<thead><tr>
<th>
                <p>
                  Name
                </p>
              </th>
<th>
                <p>
                  Description
                </p>
              </th>
</tr></thead>
<tbody>
<tr>
<td>
                <p>
                  <a class="link" href="boost__beast__handler_ptr/element_type.html" title="handler_ptr::element_type"><span class="bold"><strong>element_type</strong></span></a>
                </p>
              </td>
<td>
                <p>
                  The type of element stored.
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <a class="link" href="boost__beast__handler_ptr/handler_type.html" title="handler_ptr::handler_type"><span class="bold"><strong>handler_type</strong></span></a>
                </p>
              </td>
<td>
                <p>
                  The type of handler stored.
                </p>
              </td>
</tr>
</tbody>
</table></div>
<h5>
<a name="beast.ref.boost__beast__handler_ptr.h2"></a>
        <span class="phrase"><a name="beast.ref.boost__beast__handler_ptr.member_functions"></a></span><a class="link" href="boost__beast__handler_ptr.html#beast.ref.boost__beast__handler_ptr.member_functions">Member Functions</a>
      </h5>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
</colgroup>
<thead><tr>
<th>
                <p>
                  Name
                </p>
              </th>
<th>
                <p>
                  Description
                </p>
              </th>
</tr></thead>
<tbody>
<tr>
<td>
                <p>
                  <a class="link" href="boost__beast__handler_ptr/get.html" title="handler_ptr::get"><span class="bold"><strong>get</strong></span></a>
                </p>
              </td>
<td>
                <p>
                  Return a pointer to the owned object.
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <a class="link" href="boost__beast__handler_ptr/handler.html" title="handler_ptr::handler"><span class="bold"><strong>handler</strong></span></a>
                </p>
              </td>
<td>
                <p>
                  Return a reference to the handler.
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <a class="link" href="boost__beast__handler_ptr/handler_ptr.html" title="handler_ptr::handler_ptr"><span class="bold"><strong>handler_ptr</strong></span></a>
                </p>
              </td>
<td>
                <p>
                  Default constructor (deleted).
                </p>
                <p>
                  Move constructor.
                </p>
                <p>
                  Copy constructor (deleted).
                </p>
                <p>
                  Constructor.
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <a class="link" href="boost__beast__handler_ptr/has_value.html" title="handler_ptr::has_value"><span class="bold"><strong>has_value</strong></span></a>
                </p>
              </td>
<td>
                <p>
                  Return true if *this owns an object.
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <a class="link" href="boost__beast__handler_ptr/invoke.html" title="handler_ptr::invoke"><span class="bold"><strong>invoke</strong></span></a>
                </p>
              </td>
<td>
                <p>
                  Invoke the handler in the owned object.
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <a class="link" href="boost__beast__handler_ptr/operator_star_.html" title="handler_ptr::operator*"><span class="bold"><strong>operator*</strong></span></a>
                </p>
              </td>
<td>
                <p>
                  Return a reference to the owned object.
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <a class="link" href="boost__beast__handler_ptr/operator_arrow_.html" title="handler_ptr::operator-&gt;"><span class="bold"><strong>operator-&gt;</strong></span></a>
                </p>
              </td>
<td>
                <p>
                  Return a pointer to the owned object.
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <a class="link" href="boost__beast__handler_ptr/operator_eq_.html" title="handler_ptr::operator="><span class="bold"><strong>operator=</strong></span></a>
                </p>
              </td>
<td>
                <p>
                  Copy assignment (deleted).
                </p>
                <p>
                  Move assignment (deleted).
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <a class="link" href="boost__beast__handler_ptr/release_handler.html" title="handler_ptr::release_handler"><span class="bold"><strong>release_handler</strong></span></a>
                </p>
              </td>
<td>
                <p>
                  Return ownership of the handler.
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <a class="link" href="boost__beast__handler_ptr/handler_ptr_dtor_.html" title="handler_ptr::~handler_ptr"><span class="bold"><strong>~handler_ptr</strong></span></a>
                </p>
              </td>
<td>
                <p>
                  Destructor.
                </p>
              </td>
</tr>
</tbody>
</table></div>
<h5>
<a name="beast.ref.boost__beast__handler_ptr.h3"></a>
        <span class="phrase"><a name="beast.ref.boost__beast__handler_ptr.description"></a></span><a class="link" href="boost__beast__handler_ptr.html#beast.ref.boost__beast__handler_ptr.description">Description</a>
      </h5>
<p>
        This is a smart pointer that retains unique ownership of an object through
        a pointer. Memory is managed using the allocator associated with a completion
        handler stored in the object. The managed object is destroyed and its memory
        deallocated when one of the following occurs:
      </p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
            The function <a class="link" href="boost__beast__handler_ptr/invoke.html" title="handler_ptr::invoke"><code class="computeroutput"><span class="identifier">handler_ptr</span><span class="special">::</span><span class="identifier">invoke</span></code></a> is called.
          </li>
<li class="listitem">
            The function <a class="link" href="boost__beast__handler_ptr/release_handler.html" title="handler_ptr::release_handler"><code class="computeroutput"><span class="identifier">handler_ptr</span><span class="special">::</span><span class="identifier">release_handler</span></code></a> is called.
          </li>
<li class="listitem">
            The container is destroyed.
          </li>
</ul></div>
<p>
        Objects of this type are used in the implementation of composed operations
        with states that are expensive or impossible to move. This container manages
        that non-trivial state on behalf of the composed operation.
      </p>
<h5>
<a name="beast.ref.boost__beast__handler_ptr.h4"></a>
        <span class="phrase"><a name="beast.ref.boost__beast__handler_ptr.thread_safety"></a></span><a class="link" href="boost__beast__handler_ptr.html#beast.ref.boost__beast__handler_ptr.thread_safety">Thread
        Safety</a>
      </h5>
<p>
        <span class="emphasis"><em>Distinct</em></span> <span class="emphasis"><em>objects:</em></span> Safe.
      </p>
<p>
        <span class="emphasis"><em>Shared</em></span> <span class="emphasis"><em>objects:</em></span> Unsafe.
      </p>
<h5>
<a name="beast.ref.boost__beast__handler_ptr.h5"></a>
        <span class="phrase"><a name="beast.ref.boost__beast__handler_ptr.template_parameters"></a></span><a class="link" href="boost__beast__handler_ptr.html#beast.ref.boost__beast__handler_ptr.template_parameters">Template
        Parameters</a>
      </h5>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
</colgroup>
<thead><tr>
<th>
                <p>
                  Type
                </p>
              </th>
<th>
                <p>
                  Description
                </p>
              </th>
</tr></thead>
<tbody>
<tr>
<td>
                <p>
                  <code class="computeroutput"><span class="identifier">T</span></code>
                </p>
              </td>
<td>
                <p>
                  The type of the owned object. Must be noexcept destructible.
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <code class="computeroutput"><span class="identifier">Handler</span></code>
                </p>
              </td>
<td>
                <p>
                  The type of the completion handler.
                </p>
              </td>
</tr>
</tbody>
</table></div>
<p>
        Convenience header <code class="literal">&lt;<a href="../../../../../../boost/beast/core.hpp" target="_top">boost/beast/core.hpp</a>&gt;</code>
      </p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2016, 2017 Vinnie Falco<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="boost__beast__get_lowest_layer.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../ref.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="boost__beast__handler_ptr/element_type.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
